package 每天一题;

import java.util.HashSet;
import java.util.Set;

/**
 * @ClassName : _575_分糖果
 * @Author : 骆发茂
 * @Date: 2022/6/23 19:21
 * @Description :
 */
public class _575_分糖果 {

    public int distributeCandies(int[] candyType) {
        Set<Integer> set = new HashSet<>();

        for (int candy : candyType) {
            set.add(candy);
        }
        return Math.min(candyType.length / 2, set.size());
    }


}